home *** CD-ROM | disk | FTP | other *** search
- Path: rain.fr!world-net!usenet
- From: Frederic LACHASSE <lachass@worldnet.fr>
- Newsgroups: comp.lang.c++
- Subject: Re: Help with derived class of ifstream class
- Date: Sun, 10 Mar 1996 18:56:46 +0000
- Organization: World-Net information exchange, Internet provider.
- Message-ID: <VA.00000069.007dc50a@fred>
- References: <4hob5n$65c@daily-planet.nodak.edu>
- Reply-To: lachass@worldnet.fr
- NNTP-Posting-Host: pm9-009.sct.fr
- X-Newsreader: Virtual Access by Ashmount Research Ltd, http://www.ashmount.com
-
- In article <4hob5n$65c@daily-planet.nodak.edu>, jengel@plains.nodak.edu
- (John H. Engel) wrote:
- >
- > class X : public ifstream {
- > ...
- > };
- >
- > int X::read(){
- > int i;
- > (*this) >> i; // this is ok
- > (*this) >> hex >> i; // compiler does not like this
- > };
-
- Use "::hex" instead of "hex". X is a subclass of ifstream, which has hex
- defined in an enum of its ios base class, but you want to use the "ios&
- hex(ios&)" defined outside the ios class.
-
- I hope this'll help.
-
- Frederic LACHASSE (ECP 86)
- CompuServe: 100530,2005
- Internet: lachass@worldnet.fr
-
-